﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web.Script.Serialization;

namespace WebApi.ServiceFolder
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "WelcomeService" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select WelcomeService.svc or WelcomeService.svc.cs at the Solution Explorer and start debugging.
    public class WelcomeService : IWelcomeService
    {
        #region Api-Methods

        //Url: 'http://localhost:49906/ServiceFolder/WelcomeService.svc/json/WelcomeMessage'
        public string WelcomeMessage()
        {
            string result = string.Empty;
            try
            {
                JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();

                result = javaScriptSerializer.Serialize("Welcome to Tech-Edge [Web Api] !");
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return result;
        }
        #endregion
    }
}
